﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.master" CodeFile="AddShopHome.aspx.cs"
    Inherits="WebUI_Shop_AddShopHome" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
     <div>
           please enter your name:<asp:TextBox id="customername" runat="server" />
           Choose favorite author:
           <asp:DropDownList ID="myList"  AutoPostBack="true" runat="server" OnSelectedIndexChanged="myList_SelectedIndexChanged">
                     <asp:ListItem>Jackie</asp:ListItem>
                     <asp:ListItem>Check LI</asp:ListItem>
                      <asp:ListItem>Tom</asp:ListItem>
           </asp:DropDownList>
           <p><asp:Label ID="msg1" runat="server" /></p>
     </div>
    <div>
        店铺名称：<input id="ShopName" name="ShopName" type="text" />
        <input type="button" value="下一步" onclick="shopNameChanged($('#ShopName'))" />
    </div>
    <div id="shopnamelist">
    </div>
    <script type="text/javascript">
        function shopNameChanged(ctrl) {
            var shopName = $(ctrl).val();
            var res = ASP.webui_shop_addshophome_aspx.GetFindResult(shopName);
            if (res.value && res.value.length == 0) {
                alert();
                $("#Form1").submit();
                return;
            }
            var listCtrl = $("#shopnamelist");
            listCtrl.html("");
            for (var i = 0; i < res.value.length; i++) {
                $("<div>").html(res.value[i]).appendTo(listCtrl);
            }
        }
    </script>
</asp:Content>
